package com.chenjun.core.vo.activiti;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import com.chenjun.core.dao.generator.entity.OaBillOvertimeApplication;

@SuppressWarnings("serial")
public class OvertimeDto implements Serializable {

	private Integer id;

	private String note;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date onDutyTime;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date offDutyTime;

	private Integer isHolidays;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Date getOnDutyTime() {
		return onDutyTime;
	}

	public void setOnDutyTime(Date onDutyTime) {
		this.onDutyTime = onDutyTime;
	}

	public Date getOffDutyTime() {
		return offDutyTime;
	}

	public void setOffDutyTime(Date offDutyTime) {
		this.offDutyTime = offDutyTime;
	}

	public Integer getIsHolidays() {
		return isHolidays;
	}

	public void setIsHolidays(Integer isHolidays) {
		this.isHolidays = isHolidays;
	}
	
	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static OvertimeDto getDtoByModel(OaBillOvertimeApplication source) throws IllegalAccessException, InvocationTargetException{
		OvertimeDto target = new OvertimeDto();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static OaBillOvertimeApplication getModelByDto(OvertimeDto source) throws IllegalAccessException, InvocationTargetException{
		OaBillOvertimeApplication target = new OaBillOvertimeApplication();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
